package com.ds.lens.data.vo.in.v2.datasource;

import com.ds.lens.data.common.document.datasource.LensDsSchema;
import com.ds.lens.data.common.document.datasource.LensDsSource;
import com.ds.lens.data.common.document.datasource.LensDsSql;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

/**
 * @author WeiShaoying
 * @date 2020/5/12 下午2:15
 */
@Setter
@Getter
public class LensDatasourceInVO {
    /**
     * 主键
     */
    private Long id;

    /**
     * 名称
     */
    @NotEmpty(message = "名称不能为空")
    private String name;

    /**
     * 数据来源类型：1kafka
     */
    private Integer type;

    /**
     * source
     */
    @NotNull(message = "source不能为空")
    @Valid
    private LensDsSource source;

    /**
     * schema
     */
    @NotNull(message = "schema不能为空")
    @Valid
    private List<LensDsSchema> dsSchema;

    /**
     * sql
     */
    @NotNull(message = "sql不能为空")
    @Valid
    private LensDsSql dsSql;

    /**
     * 指标
     */
    @NotNull(message = "metric不能为空")
    private Map<String, String> metric;

    /**
     * 标签
     */
    @NotNull(message = "tags不能为空")
    private Map<String, String> tags;

    /**
     * 应用id
     */
    @NotNull(message = "应用id不能为空")
    private Long applicationId;

}
